/******************************************************************
 * Copyright(c)  : Industry.soufun.com 2013
 * Description   : Auto generat code 
 * CreateDate    : 2013-10-26
 * Creater       : Industry
 * LastChangeDate: 
 * LastChanger   : 
 * Version Info  : 1.0
 * ******************************************************************/
using System;
using System.Data;
using System.Collections.Generic;
using Industry.Proj.EntityCore;
using Industry.Proj.Data;
using Onlyle.Model;

namespace Onlyle.DAO
{
    public class UserDA
    {
		#region Add
		public static bool AddUser(E_User User)
        {
            using(DataAccessBroker broker = DataAccessFactory.Instance())
            {
                try
                {
                    DataAccess.Insert(User,broker);
                    return true;
                }
                catch
                {
                    return false;
                }
            }
        }
        public static bool AddUser(List<E_User> Userlist)
        {
            using(DataAccessBroker broker = DataAccessFactory.Instance())
            {
                return DataAccess.Insert<E_User>(Userlist, broker);
            }
        }
        #endregion
        
        #region Update

        public static bool UpDateUser(E_User User)
        {
            using(DataAccessBroker broker = DataAccessFactory.Instance())
            {
                try
                {
                    DataAccess.Update(User,broker);
                    return true;
                }
                catch
                {
                 return false;
                }
            }
        }
        public static bool UpDateUser(List<E_User> Userlist)
        {
            using(DataAccessBroker broker = DataAccessFactory.Instance())
            {
                return DataAccess.Update<E_User>(Userlist, broker);
            }
        }
        #endregion
        
        #region Delete
      
        public static bool DeleteUser(E_User User)
        {
            using(DataAccessBroker broker = DataAccessFactory.Instance())
            {
                try
                {
                    DataAccess.Delete(User,broker);
                    return true;
                }
                catch
                {
                    return false;
                }
            }
        }
        public static bool DeleteUser(List<E_User> Userlist)
        {
            using(DataAccessBroker broker = DataAccessFactory.Instance())
            {
                return DataAccess.Delete<E_User>(Userlist, broker);
            }
        }
        #endregion
        
        
        #region SELECT
        public static List<E_User> SelectAll()
        {
            using(DataAccessBroker broker = DataAccessFactory.Instance())
            {
                return DataAccess.SelectAll<E_User>(broker);
            }
        }

        public static List<E_User> Select(E_User User)
        {
            using(DataAccessBroker broker = DataAccessFactory.Instance())
            {
                return DataAccess.Select(User,broker);
            }
        }
        public static List<E_User> Select(E_User User, List<string> fieldNameList)
        {
            using(DataAccessBroker broker = DataAccessFactory.Instance())
            {
                return DataAccess.Select<E_User>(User,fieldNameList,broker);
            }
        }
        public static DataSet SelectDataSet(E_User User)
        {
            using(DataAccessBroker broker = DataAccessFactory.Instance())
            {
                return DataAccess.SelectDataSet(User,broker);
            }
        }
        
        #endregion
    }
}









